﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Enterprise.Infrastructure;
using Enterprise.Model.Meeting;
using Enterprise.Service.Meeting;
namespace Enterprise.UI.Web.Modules.Meeting
{
    public partial class Record : System.Web.UI.Page
    {
        int Id = (int)Utility.sink("Id", Utility.MethodType.Get, 0, 0, Utility.DataType.Int);
        string Cmd = (string)Utility.sink("Cmd", Utility.MethodType.Get, 0, 0, Utility.DataType.Str);
        string f = (string)Utility.sink("f", Utility.MethodType.Get, 0, 0, Utility.DataType.Str);
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                OnStart();
            }
        }

        private void OnStart()
        {
            if (string.IsNullOrEmpty(Cmd))
            {
                ulInput.Visible = false;
                SubmitDiv.Visible = false;
                MeetingService mService = new MeetingService();
                var query = mService.MeetingDisp(Id);
                if (query != null)
                {
                    lb_Content.Text = query.MFiles;
                }
            }
            else if (Cmd == "Upload")
            {
                ulShow.Visible = false;
            }
        }

        protected void BtnSave_OnClick(object sender, EventArgs e)
        {
            string s=(string)Utility.sink(t_Content.UniqueID, Utility.MethodType.Post,0,0, Utility.DataType.Str);
            string Cmd = "Update MEETING_INFO set MFILES='" + s + "' where MEETINGID=" + Id;
            MeetingService mService = new MeetingService();
            mService.MeetingExecuteBySql(Cmd);
            Utility.Closedg(this.Page);
        }

    }
}